<html>
	<head>
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script>
	<link type="text/css" href="css/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" />	
	<link type="text/css" href="css/date.css" rel="stylesheet" />	
	<script type="text/javascript">

	var details;
	unit="B7";
	function sendContractData(){
		password1=$("#password").val();
		name1=$("#name").val();
		home=$("#home_address").val();
		studnum=$("#studnum").val();
		cellnum=$("#cellnum").val();
		course=$("#course").val();
		college=$("#college").val();
		classification=$("#classification").val();
		parents=$("#parents_name").val();
		contact=$("#contact_nums").val();
		occupants=$("#other_occupants").val();
		deposit=$("#deposit").val();
		rent=$("#monthly_rent").val();
		start=$("#start_date").val();
		debts=$("#debts").val();
		$("#sendContractForm").html("");
		$("#sendContractForm").html("<img src='gifs/indicator.gif' />");
		$.post('controllers/StartContractController.php',{ 
		name: name1, 
		password: password1,
		home: home,
		studnum:studnum,
		cellnum:cellnum,
		course:course,
		college:college,
		classification: classification,
		parents:parents,
		contact:contact,
		occupants:occupants,
		deposit:deposit,
		rent:rent,
		start:start,
		debts:debts
		}, function(data) {
		  $('#sendContractForm').html(data);
		  details=data;
			displayContractDetails();
		});
		
		

		
	}
	function displayContractDetails(){
		$("#sendContractForm").html(details);
	}

	</script>
	</head>
	<body>

		<div id="sendContractForm">
		<h2>Start Contract</h2>
				New Password: <input type="text" id="password" /><br />
				Principal Lesse Name: <input type="text" id="name" /><br />
				Home Address: <input type="text" id="home_address" /><br />
				Student Number: <input type="text" id="studnum" /><br />
				Cellphone Number: <input type="text" id="cellnum" /><br />
				Course: <input type="text" id="course" /><br />
				College: <input type="text" id="college" /><br />
				Classification: <input type="text" id="classification" /><br />
				Parent's Names:<br />
				<textarea id="parents_name"></textarea>
				<br />Contact Numbers:<br />
				<textarea id="contact_nums"></textarea>
				<br />Other Occupants: <br />
				<textarea id="other_occupants"></textarea>
				<br />Deposit: <input type="text" id="deposit" /><br />
				Monthly Rent: P<input type="text" id="monthly_rent" /><br />
				<div id="datepicker">
				Start Date: <input type="text" id="start_date" /><br />
				</div>
				 <script type="text/javascript">
					$(function() {
						$("#start_date").datepicker({ dateFormat: 'yy-mm-dd' });
							});
				</script>
				Total Debts Before Automation: <input type="text" id="debts" /><br />
				<input type="button" value="Start Contract" onclick="sendContractData();return false;" />
		</div>
	</body>
</html>